<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/modules/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<title>订单信息</title>
		<%@ include file="/WEB-INF/views/modules/include/meta.jsp"%>
		<script type="text/javascript">
			//将用户放入cookie
			var cookieService = new  MallCookieService();
			cookieService.setUserId('${userId}');
			deleteCartCookie();
			$(document).ready(function(){
				//预加载图片
				startLoadImage();
			});
			function toPay(){
				document.location="${ctxShop}/shoping/order/toPayPC?orderNo=${order.orderNo }&type=${type}";
			}
		</script>
	</head>
	<body>
		<!--导航条-->
	<%@ include file="/WEB-INF/views/modules/include/top.jsp"%>

		<!-- 内容 -->
		<div class="container" style="margin-top: 40px;">
			<%@ include file="/WEB-INF/views/modules/include/left.jsp"%>
			
			<div class="col-md-6" style="left: 25%;">
				<%@ include file="/WEB-INF/views/modules/include/navicat.jsp"%>
				
				
				<div class="row content-main" style="padding:0px 20px; padding-top: 20px;" align="center">
		             	<c:if test="${myorder==null}">
		              	<div class="col-md-12 col-sm-12 col-xs-12">
		              		<c:if test="${order.payStatus==0 && order.payType!='1'}">
								<h4 style="color: #d58512; font-size: 12px;"> 订单提交成功，点击下方“去支付”完成订单支付. </h4>
							</c:if>
							<c:if test="${order.payStatus==0 && order.payType=='1'}">
								<h4 style="color: #d58512; font-size: 12px;"> 订单提交成功，返回可<a href="${ctxWeb}" style="color: blue;">继续购买</a>哦. </h4>
							</c:if>
						</div>
		              	</c:if>
		              
		                  <div class="col-md-12 col-sm-12 col-xs-12">
			            <!--支付方式-->
			            <div class="panel panel-default">
			                <div class="panel-heading text-left">
			                    <span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span>    订单信息
			                </div>
			                <div class="panel-body">
			                    <div class="row" style="padding-bottom: 10px; border-bottom: 1px solid #eee;">
			                        <div class="col-md-4 col-sm-4 col-xs-4">
			                           	订单编号：
			                        </div>
			                        <div class="col-md-8 col-sm-8 col-xs-8">
			                           ${order.orderNo }
			                        </div>
			                    </div>
			                    <div class="row" style="padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid #eee;">
			                        <div class="col-md-4 col-sm-4 col-xs-4">
			                            	订单时间：
			                        </div>
			                        <div class="col-md-8 col-sm-8 col-xs-8">
			                        	<fmt:formatDate value="${order.createDate }" pattern="yyyy-MM-dd HH:mm:ss"/>
			                        </div>
			                    </div>
			                    <div class="row" style="padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid #eee;">
			                        <div class="col-md-4 col-sm-4 col-xs-4">
			                            	订单状态：
			                        </div>
			                        <div class="col-md-8 col-sm-8 col-xs-8">
			                            	<c:if test="${order.delFlag=='0' && order.payStatus=='0' && (order.payType=='2' or order.payType=='3' or order.payType=='4')}">
							           			待付款
							    			</c:if>
							    			<c:if test="${order.delFlag=='0' && order.orderType=='0' && ((order.payStatus=='0' && order.payType=='1') || (order.payStatus=='1' && order.payType!='1'))}">
							          			待发货
							   				</c:if>
							    			<c:if test="${order.delFlag=='0' && order.orderType=='1'}">
							           			待收货
							    			</c:if>
							    			<c:if test="${order.delFlag=='0' && order.orderType=='2'}">
							           			已完成
							    			</c:if>
							    			<c:if test="${order.delFlag=='1'}">
							           			已取消
							    			</c:if>
			                        </div>
			                    </div>
			                    <div class="row" style="padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid #eee;">
			                        <div class="col-md-4 col-sm-4 col-xs-4">
			                            	支付方式：
			                        </div>
			                        <div class="col-md-8 col-sm-8 col-xs-8">
			                            	${order.payTypeDesc }
			                        </div>
			                    </div>
			                    <div class="row" style="padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid #eee;">
			                        <div class="col-md-4 col-sm-4 col-xs-4">
			                            	总金额：
			                        </div>
			                        <div class="col-md-8 col-sm-8 col-xs-8" style="color: #d58512">
			                            	￥${order.amount }
			                        </div>
			                    </div>
			                </div>
			            </div>
					</div>
		              </div>
		              
		              <div class="row" style="padding:0px 20px;">
		                  <div class="col-md-12 col-sm-12 col-xs-12">
						<!--收货时间-->
			            <div class="panel panel-default">
			                <div class="panel-heading text-left">
			                    <span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span>    商品信息(共${order.totalNumber }件)
			                </div>
			                <div class="panel-body">
						        <c:if test="${fn:length(order.detailList) != 0}">
									<c:forEach items="${order.detailList}" var="detail" varStatus="vs">
										<div class="row" style="padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid #eee;">
					                        <div class="col-md-12 col-sm-12 col-xs-12">
					                            <div class="media">
					                                <div class="media-left">
					                                        <img id="photo${vs.index }" class="displayImages media-object body_product_img pc_img"
					                                             data-src="holder.js/64x64" alt="图片"
					                                             src="${ctxFront }/images/loading.png" path="${ctxWeb}/shops/download?filePath=${detail.product.logoUrl }"
					                                             data-holder-rendered="true" />
					                                </div>
					                                <div class="media-body text-left" >
					                                    <div class="media-body">
					                                        <strong>${detail.product.name }</strong>
					                                    </div>
					                                    <label>
					                                        ${detail.product.startSaleNum*detail.product.productUnit.number}${detail.product.productUnit.name }起购
					                                    </label></br>
					                                    <label>
					                                    	单价：<font  color="red">￥${detail.price }</font> / ${detail.product.productUnit.number}${detail.product.productUnit.name }
					                                    </label></br>
					                                    <label>
					                                       	 数量：${detail.number }
					                                    </label>
					                                </div>
					                            </div>
					                        </div>
					                    </div>
									</c:forEach>
								</c:if>
			                </div>
			            </div>
					</div>
		              </div>
		              
		              <div class="row" style="padding:0px 20px; padding-bottom: 50px;">
		                  <div class="col-md-12 col-sm-12 col-xs-12">
						<!--收货地址-->
			            <div class="panel panel-default">
			                <div class="panel-heading text-left">
			                    <span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span>    收货地址
			                </div>
			                <div class="panel-body">
								<div class="row">
			                        <div class="col-md-12 col-sm-12 col-xs-12">
			                            <div class="media">
			                                <div class="media-body text-left" >
			                                    <p>
			                                        	收货人姓名：<strong>${order.userAddress.name }</strong>
			                                    </p>
			                                    <p>
			                                        	收货人电话：<strong>${order.userAddress.phone }</strong>
			                                    </p>
			                                    <p>
			                                        	收货人地址：<strong>${order.userAddress.detailAddress }</strong>
			                                    </p>
			                                    <p>
			                              				收货时间：<strong>${order.timeSlot.timeText }</strong>
			                                    </p>
			                                </div>
			
			                            </div>
			                        </div>
			                    </div>
			                </div>
			            </div>
					</div>
		    	</div>
			</div>
			<%@ include file="/WEB-INF/views/modules/include/right.jsp"%>
   </div>
   
   <c:if test="${order.payStatus==0 && order.payType!='1' && order.delFlag=='0'}">
	<!-- 底部 -->
	<nav class="container navbar navbar-default navbar-fixed-bottom pc_bottom_width" style="width: 50%;">
		<div class="container-fluid text-center">
               <div class="row">
                   <div class="col-md-3 col-sm-3 col-xs-3 pc_color">
                   </div>
                   <div class="col-md-6 col-sm-6 col-xs-6 pc_color">
                   </div>
                   <div class="col-md-2 col-sm-2 col-xs-2 pc_right">
                   		<img alt="" src="${ctxFront }/images/shop/toPay.png" height="35" style="margin: 7.5px 1em 7.5px 0px;" onclick="toPay()">
                   </div>
               </div>
           </div>
	</nav>
	</c:if>
	</body>
</html>
